import { SmsParams,LoginParams,SmsLoginParams ,VerifySms,PasdData,ForgetPassword} from "./types"
import { request } from '@/utils/request'
import { request2 } from '@/utils/request2'
// 获取用户信息
export const apiGetProfile = () => {
  return request2({
    url: '/api/mini-program/talents/profile',
    method: 'get',
  })
}
// 获取用户信息二
export const apiGetUserInfo = () => {
  return request2({
    url: '/api/mini-program/talents/user/info',
    method: 'get',
  })
}
// 可提现金额
export const getWithdrawableAmount = () => {
  return request2({
    url: '/api/mini-program/talents/withdrawal/wallet',
    method: 'get',
  })
}
// 账密登录
export const login = (data:LoginParams) => {
  return request({
    url: '/user/login/account',
    method: 'post',
    data
  })
}

// 获取手机验证码
export const getSms = (data:SmsParams) => {
  return request({
    url: '/sms/send',
    method: 'post',
    data
  })
}

// 手机短信登录
export const smsLogin = (data:SmsLoginParams) => {
  return request({
    url: '/user/login/aliSmsLogin',
    method: 'post',
    data
  })
}

// 验证手机验证码是否正确
export const verifySms = (data:VerifySms) => {
  return request({
    url: '/sms/check',
    method: 'post',
    data
  })
}



// 设置密码
export const setPassword = (data:PasdData) => {
  return request({
    url: '/user/setPassword',
    method: 'post',
    data
  })
}

// 忘记密码
export const forgetPassword = (data:ForgetPassword) => {
  return request({
    url: '/user/retrievePassword',
    method: 'post',
    data
  })
} 

